﻿using System.Collections.Generic;
using System.ServiceModel;
using Collab.Services.Remote.Entities;

namespace Collab.Services.Remote.Contracts
{
    [ServiceContract(Namespace = "http://collab.codeplex.com/2010/10", CallbackContract = typeof(IRemoteCollaborationCallback), SessionMode= SessionMode.Required)]
    [DeliveryRequirements(RequireOrderedDelivery = true)]
    public interface IRemoteCollaborationService
    {
        [OperationContract()]
        void Subscribe(User user);

        [OperationContract]
        IList<User> GetCurrentUsers();

        [OperationContract]
        DocumentSnapshot GetCurrentRevision(string documentName);

        [OperationContract]
        Solution GetSolutionInformation();

        [OperationContract(IsOneWay = true)]
        void RequestFile(FileRequest fileRequest);

        [OperationContract()]
        void Unsubscribe(User user);

        [OperationContract(IsOneWay = true)]
        void SendChange(BufferUpdate change);

        [OperationContract(IsOneWay = true)]
        void SendUserStatus(UserStatus status);

        [OperationContract(IsOneWay = true)]
        void SendFileAdded(AddedFileInformation fileInformation);

        [OperationContract(IsOneWay = true)]
        void SendFileChunk(FileChunk fileChunk);

    }
}
